<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 300px;
            height: 300px;
            text-align: center;
            margin: 200PX auto;
            border: 1px solid #000;
        }

        .nav {
            padding: 50px 20px;
        }

        .start {
            margin: 10px 30px;
        }

        .end {
            margin: 10px 30px;
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="head">
            <h3>
                每日一问
            </h3>
        </div>
        <div class="nav">
            问题是:
            <span class="content">
                ?x?=?
            </span>
        </div>
        <button class="start">开始</button>
        <button class="end">结束</button>
    </div>
    <script>
        let timeid = 0
        let answer = 0
        const arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
        const cnt = document.querySelector('.content')
        const start = document.querySelector('.start')
        const end = document.querySelector('.end')
        start.addEventListener('click', function () {
            timeid = setInterval(function () {
                let random1 = parseInt(Math.random() * arr.length)
                let random2 = parseInt(Math.random() * arr.length)
                answer = arr[random1] * arr[random2]
                cnt.innerText = arr[random1] + 'x' + arr[random2] + '=?'
            }, 100)
        })
        end.addEventListener('click', function () {
            clearInterval(timeid)
        })
    </script>
</body>

</html>